package com.byb.server.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 疾病信息
 */
@ApiModel(description = "疾病信息")
@Entity
@Table(name = "illness_info")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "illnessinfo")
public class IllnessInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 疾病名称
     */
    @ApiModelProperty(value = "疾病名称")
    @Column(name = "illness_name")
    private String illnessName;

    /**
     * 赔付概率
     */
    @ApiModelProperty(value = "赔付概率")
    @Column(name = "incidence")
    private String incidence;

    /**
     * 疾病定义
     */
    @ApiModelProperty(value = "疾病定义")
    @Lob
    @Column(name = "disease_definition")
    private String diseaseDefinition;

    /**
     * 易发人群
     */
    @ApiModelProperty(value = "易发人群")
    @Lob
    @Column(name = "susceptible_population")
    private String susceptiblePopulation;

    /**
     * 医疗水平
     */
    @ApiModelProperty(value = "医疗水平")
    @Lob
    @Column(name = "medical_level")
    private String medicalLevel;

    /**
     * 可赔偿情况
     */
    @ApiModelProperty(value = "可赔偿情况")
    @Lob
    @Column(name = "compensable_circumstances")
    private String compensableCircumstances;

    /**
     * 不可赔偿情况
     */
    @ApiModelProperty(value = "不可赔偿情况")
    @Lob
    @Column(name = "un_compensable_circumstances")
    private String unCompensableCircumstances;

    @ManyToOne
    private TypeOfCase typeOfCase;

    @ManyToOne
    private Product product;

    // jhipster-needle-entity-add-field - Jhipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIllnessName() {
        return illnessName;
    }

    public IllnessInfo illnessName(String illnessName) {
        this.illnessName = illnessName;
        return this;
    }

    public void setIllnessName(String illnessName) {
        this.illnessName = illnessName;
    }

    public String getIncidence() {
        return incidence;
    }

    public IllnessInfo incidence(String incidence) {
        this.incidence = incidence;
        return this;
    }

    public void setIncidence(String incidence) {
        this.incidence = incidence;
    }

    public String getDiseaseDefinition() {
        return diseaseDefinition;
    }

    public IllnessInfo diseaseDefinition(String diseaseDefinition) {
        this.diseaseDefinition = diseaseDefinition;
        return this;
    }

    public void setDiseaseDefinition(String diseaseDefinition) {
        this.diseaseDefinition = diseaseDefinition;
    }

    public String getSusceptiblePopulation() {
        return susceptiblePopulation;
    }

    public IllnessInfo susceptiblePopulation(String susceptiblePopulation) {
        this.susceptiblePopulation = susceptiblePopulation;
        return this;
    }

    public void setSusceptiblePopulation(String susceptiblePopulation) {
        this.susceptiblePopulation = susceptiblePopulation;
    }

    public String getMedicalLevel() {
        return medicalLevel;
    }

    public IllnessInfo medicalLevel(String medicalLevel) {
        this.medicalLevel = medicalLevel;
        return this;
    }

    public void setMedicalLevel(String medicalLevel) {
        this.medicalLevel = medicalLevel;
    }

    public String getCompensableCircumstances() {
        return compensableCircumstances;
    }

    public IllnessInfo compensableCircumstances(String compensableCircumstances) {
        this.compensableCircumstances = compensableCircumstances;
        return this;
    }

    public void setCompensableCircumstances(String compensableCircumstances) {
        this.compensableCircumstances = compensableCircumstances;
    }

    public String getUnCompensableCircumstances() {
        return unCompensableCircumstances;
    }

    public IllnessInfo unCompensableCircumstances(String unCompensableCircumstances) {
        this.unCompensableCircumstances = unCompensableCircumstances;
        return this;
    }

    public void setUnCompensableCircumstances(String unCompensableCircumstances) {
        this.unCompensableCircumstances = unCompensableCircumstances;
    }

    public TypeOfCase getTypeOfCase() {
        return typeOfCase;
    }

    public IllnessInfo typeOfCase(TypeOfCase typeOfCase) {
        this.typeOfCase = typeOfCase;
        return this;
    }

    public void setTypeOfCase(TypeOfCase typeOfCase) {
        this.typeOfCase = typeOfCase;
    }

    public Product getProduct() {
        return product;
    }

    public IllnessInfo product(Product product) {
        this.product = product;
        return this;
    }

    public void setProduct(Product product) {
        this.product = product;
    }
    // jhipster-needle-entity-add-getters-setters - Jhipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        IllnessInfo illnessInfo = (IllnessInfo) o;
        if (illnessInfo.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), illnessInfo.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "IllnessInfo{" +
            "id=" + getId() +
            ", illnessName='" + getIllnessName() + "'" +
            ", incidence='" + getIncidence() + "'" +
            ", diseaseDefinition='" + getDiseaseDefinition() + "'" +
            ", susceptiblePopulation='" + getSusceptiblePopulation() + "'" +
            ", medicalLevel='" + getMedicalLevel() + "'" +
            ", compensableCircumstances='" + getCompensableCircumstances() + "'" +
            ", unCompensableCircumstances='" + getUnCompensableCircumstances() + "'" +
            "}";
    }
}
